package com.sushe.service;

import com.sushe.dao.StudentDao;
import com.sushe.service.jiekou.StudentService;

import java.util.Scanner;


public class StudentServiceImpl implements StudentService {

    private StudentDao studentDao=new StudentDao();



    @Override
    public  void addStudent() {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入学生姓名：");
        String name=sc.nextLine();
        System.out.println("请输入学生班级名称：");
        String className=sc.nextLine();
        try{
            studentDao.addStudent(name,className);
            System.out.println("添加成功！");
        }catch(Exception e){
            System.out.println("添加失败："+e.getMessage());
        }
    }
}
